//用于部署智能合约的脚本，使用 Hardhat（一个以太坊开发环境）来部署合约。
import { ethers } from "hardhat";

async function main() {
  const VotingFactory = await ethers.getContractFactory("VotingFactory");
  const votingFactory = await VotingFactory.deploy(); //deploy(): 部署合约到区块链
  console.log("VotingFactory deployed to:", votingFactory.target);
}
//错误处理
main().catch((error) => {
  console.error(error);
  process.exitCode = 1;
});
